/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package janino;

import java.io.IOException;
import java.io.OutputStream;
import javax.microedition.lcdui.Form;

/**
 *
 * @author rosiane
 */
public class FormOutputStream extends OutputStream {

    private final Form form;

    public FormOutputStream(Form form) {
        this.form = form;
    }

    public void write(int b) throws IOException {
        this.form.append("" + (char) b);
    }

    public void write(byte[] b) throws IOException {
        this.form.append(new String(b));
    }

    public void write(byte[] b, int off, int len) throws IOException {
        this.form.append(new String(b, off, len));
    }
}
